//会员消费记录-通用卷-优惠券
<template>
    <view class="my_gift">
		<tabbar :showLabel="false" :active="active" :tab="tab" @change_status="change_status"></tabbar>
		<reCord :express_data="fun(express,active)" v-if="active == 0"></reCord>
		<reCord :express_data="fun(express,active)" v-if="active == 1"></reCord>
		<reCord :express_data="fun(express,active)" v-if="active == 2"></reCord>
    </view>
</template>
<script>
	import reCord from 'pages/user/components/record.vue'
export default {
    components: {
		reCord
    },
    data() {
        return {
            active: 0,
            tab: [
				
                {
                    id: 0,
                    label: "线下消费",
                },
                {
                    id: 1,
                    label: "优惠券消费",
                },
                {
                    id: 2,
                    label: "通用卷消费",
                },
            ],
            express: [
                {
                    id: 0,
                    img: 'https://kuaichuang.insunny.cc/temp_img//goods5.png',
                    title: '九阳迷你形家用电磁炉三年全国保修',
                    label: 800,
                    num1: 8800,
                    num2: 10000,
                    express_status: '线下消费',
                    status: 0,
					type: '已完成',
                },
                {
                    id: 1,
                    img: 'https://kuaichuang.insunny.cc/temp_img//goods5.png',
                    title: '九阳迷你形家用电磁炉三年全国保修',
                    label: 800,
                    num1: 8800,
                    num2: 10000,
                    express_status: '优惠券消费',
                    status: 0,
					type: '已发货',
                },
                {
                    id: 2,
                    img: 'https://kuaichuang.insunny.cc/temp_img//goods5.png',
                    title: '九阳迷你形家用电磁炉三年全国保修',
                    label: 800,
                    num1: 8800,
                    num2: 10000,
                    express_status: '通用卷消费',
                    type: '待发货',
                    status: 0,
                },
            ],
        };
    },
    computed: {},
    methods: {
        change_status(index) {
            this.active = index
        },
        fun (express,active){
            var arr = []
            express.forEach((item,index) => {
                if(item.express_status == '线下消费' && active == 0){
                    arr.push(item)
                }
                else if(item.express_status == '优惠券消费' && active == 1){
                    arr.push(item)
                }
                else if(item.express_status == '通用卷消费' && active == 2){
                    arr.push(item)
                }
            });
            return arr 
        }
    },
    beforeCreate() {},
    created() {},
    beforeMount() {},
    mounted() {
    },
    beforeUpdate() {},
    updated() {},
    beforeDestroy() {},
    destroyed() {},
};
</script>
<style scoped lang='scss'>
.my_gift{
	width: 100%;
	height: 100%;
	padding: 0 32rpx 32rpx;
	box-sizing: border-box;
	padding-bottom: constant(safe-area-inset-bottom);
	padding-bottom: env(safe-area-inset-bottom);
}
</style>
<style>
	page{
		background-color: #fff;
	}
</style>